/**
 * Created by Catherine Liu on 2016/4/16.
 */
import java.util.*;
import static java.lang.System.out;

public class TimeZoneDemo2 {
    public static void main(String[] args) {
        TimeZone beijingTz = TimeZone.getTimeZone("Asia/Beijing");
        Calendar calendar = Calendar.getInstance(beijingTz);
        showTime(calendar);

        TimeZone copenhagenTz = TimeZone.getTimeZone("Europe/Copenhagen");
        calendar.setTimeZone(copenhagenTz);
        showTime(calendar);
    }

    static void showTime(Calendar calendar) {
        out.print(calendar.getTimeZone().getDisplayName());;
        out.printf(" %d:%d%n",
                calendar.get(Calendar.HOUR),
                calendar.get(Calendar.MINUTE));
    }
}